package com.tvunetworks.device.extra.service;

import com.tvunetworks.center.common.util.Result;
import com.tvunetworks.device.extra.model.param.UpdateExtParam;

/**
 * @author Etan Yang
 * @create: 2021/11/19 14:11
 */

public interface ExtService {
    /**
     * add Ext to user,if there is no user in CC service, create a user and the user role defaults to 'user'
     *
     * @param userId             userId
     * @param sourceName         ExtName
     * @param sourceType         type
     * @param url                url
     * @param rid                receiverId, if sendToReceiverFlag=true,the value must be passed
     * @return ext sourceId
     */
    String addExtToUser(String userId, String sourceName, String sourceType, String url, String rid);

    /**
     * update ext name or url
     * @param param updateExtParam
     * @return result
     */
    Result updateExt(UpdateExtParam param);

    /**
     * delete ext
     * @param sourceId ext sourceId
     * @param userId   userId
     * @return result
     */
    Result deleteExt(String sourceId, String userId);
}
